﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Game
{
    /*-------------------------------------------------------------------------
    | AICharacterManager:
    | ------------
    | AI Manager
    |---------------------------------------------------------------------------*/
    public class AICharacterManager : CharacterControlerManager
    {
        List<CharacterControl> mAICharacters = new List<CharacterControl>();

        public void UpdateLogic()
        {
            mAICharacters.Clear();
            //Prepare AI Character
            foreach (CharacterControl it in this)
            {
                if (it is IAILogic)
                {
                    mAICharacters.Add(it as CharacterControl);
                }
            }


            // AI State Update
            //.....

            //AI Apply
            foreach (CharacterControl it in mAICharacters)
            {
                (it as IAILogic).UpdateLogic(this);
            }
        }

        public override void Update(Events.ProcessSceneUpdate evnt)
        {
            UpdateLogic();
            base.Update(evnt);
        }
    }
}
